=Search Syntax=
An Everything search consists of one or more [[#syntax|search terms]] joined by [[#operators|search operators]].

<beta1.5>

[[#syntax|Syntax]]
[[#operators|Operators]]
[[#wildcards|Wildcards]]
[[#macros|Macros]]
[[#charentities|Character Entities]]
[[#parts|Filename Parts]]
[[#see_also|See also]]



==syntax|Syntax==

A search term specifies what to search.
The basic structure of a single search term is:

`[!][search-modifier:][search-function:]<text>`

<dl>
;!
Optional [[#operators|NOT operator]] to exclude the search term.

;search-modifier:
Optional [[support/everything/search_modifiers|search modifiers]]. 
Multiple search modifiers may be specified to change how the search term is matched.
Search modifiers override default settings in the '''Search''' menu, allowing you to temporarily enable or disable matching options.

;search-function:
Optional [[support/everything/search_functions|search function]] to search a specific property, such as a date or size.

;text
Search text or a value interpreted by the search function.
Literal text without a search function matches file and folder names.
If '''Match Path''' is enabled in the '''Search''' menu, literal text matches against the full path instead.
</dl>

For example:
`abc` = matches filenames containing abc
`path:abc` = matches full paths containing abc
`date-modified:today` = matches files and folders modified today
`case:extension:JPG` = matches files with an extension containing uppercase JPG
`!abc` = excludes filenames containing abc



Search terms can be combined with [[#operators|search operators]] to create more complex search expressions.

`<search-term> <operator> <search-term> ...`

For example:
`abc 123` = matches filenames containing both `abc` AND `123`
`*.jpg | *.png` = matches files with a `jpg` OR `png` extension




==operators|Operators==

Operators combine [[#syntax|search terms]] and control how they are evaluated.

<dl>
;and|''space''
'''AND''' search terms together.

For example:
`abc 123` = matches `abc` AND `123`



;or||
'''OR''' search terms together.

Spaces immediately before or after `|` are ignored.

For example:
`abc|123` = matches `abc` OR `123`
`abc | 123` = matches `abc` OR `123`



;not|!
'''NOT''' a search term.
The search term that immediately follows is excluded.

For example:
`!abc` = matches NOT `abc`



;grouping|< >
'''Group''' search terms together to change the evaluation order.

For example:
`!<abc 123>` = matches NOT (`abc` AND `123`)



;quote|" "
'''Quote''' search text.
Treats everything inside the quotes (including operators) as plain text.

For example:
`"C:\Program Files"` = matches the text: `C:\Program Files`
</dl>



By default, OR is evaluated before AND.

For example:
`apple banana | orange` = matches `apple` AND (`banana` OR `orange`)

Use grouping `< >` to change the evaluation order.

For example:
`<apple banana> | orange` = matches (`apple` AND `banana`) OR `orange`

Operator precedence can be changed in the [[support/everything/options/#operator_precedence|Search Options]].



==wildcards|Wildcards==

The following wildcards can be used in Everything searches:
{|
| <span id="star">*</span>
| Matches zero or more characters (except `\`)
|-
| <span id="starstar">**</span>
| Matches zero or more characters
|-
| <span id="question">?</span>
| Matches one character (except `\`)
|}



The whole filename is matched when using wildcards.

For example:
`*.mp3` = matches mp3 files
`foo*` = matches filenames starting with foo
`*foo*` = matches filenames containing foo
`stem:*bar` = matches filenames ending with bar (ignoring extension)



==macros|Macros==

The following macros can be used in Everything searches:
{|
| audio:
| Matches audio files.
|-
| doc:
| Matches document files.
|-
| exe:
| Matches executable files.
|-
| image:
| Matches image files.
|-
| video:
| Matches video files.
|-
| zip:
| Matches compressed files.
|}

For example:
`audio:` = matches audio files
`audio:|video:` = matches audio or video files

Custom macros can be defined.
See [[support/everything/searching/#macros|Macros]] for more information.



==charentities|Character Entities==

The following character entities can be used in Everything searches:
{|
| &sp:
| Literal space (` `)
|-
| &vert:
| Literal vertical line (`|`)
|-
| &excl:
| Literal exclamation mark (`!`)
|-
| &lt:
| Literal less than (`<`)
|-
| &gt:
| Literal greater than (`>`)
|-
| &quot:
| Literal double quote (`"`)
|-
| &#<n>:
| Literal Unicode character <n> in decimal.
|-
| &#x<n>:
| Literal Unicode character <n> in hexadecimal.
|}



For example:
`C:\Program&sp:Files` = match files/folders in `C:\Program files`
`&excl:readme.txt` = match filenames containing `!readme.txt`
`content:&quot:foo&quot:` = match file content containing `"foo"`
`diacritics:&#xad:` = match filenames containing a soft hyphen (`-`)

[[/forum/viewtopic.php?p=65789#p65789|Character Entities]]



==parts|Filename parts==

The following filename parts describe the different components of a filename in Everything:
{|
| Full Path
| <code>C:\folder\file.txt</code>
|-
| Name
| <code>file.txt</code>
|-
| Path
| <code>C:\folder</code>
|-
| Stem
| <code>file</code>
|-
| Extension
| <code>txt</code>
|}



==see_also|See also==

<ul>
*[[support/everything/search_modifiers|Search Modifiers]]
*[[support/everything/search_functions|Search Functions]]
*[[support/everything/ini/#operator_precedence|operator_precedence]]
</ul>